package com.monco.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.monco.entity.RubbishDetail;
import com.monco.mapper.RubbishDetailMapper;
import com.monco.service.IRubbishDetailService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
/**
* <p>
    *  服务实现类
    * </p>
*
* @author com/monco
* @since 2020-04-19
*/
@Service
public class RubbishDetailServiceImpl extends ServiceImpl<RubbishDetailMapper, RubbishDetail> implements IRubbishDetailService {

    @Resource
    private RubbishDetailMapper rubbishDetailMapper;

    @Override
    public List<RubbishDetail> getRubbishDetailList(RubbishDetail rubbishDetail) {
        return rubbishDetailMapper.selectList(getWrapper(rubbishDetail));
    }

    @Override
    public IPage<RubbishDetail> getRubbishDetailPage(IPage<RubbishDetail> page, RubbishDetail rubbishDetail) {
        return rubbishDetailMapper.selectPage(page, getWrapper(rubbishDetail));
    }

    private QueryWrapper<RubbishDetail> getWrapper(RubbishDetail rubbishDetail) {
        QueryWrapper<RubbishDetail> queryWrapper = new QueryWrapper<>();
        return queryWrapper;
    }
}
